package com.veeder.datacollection.rs232.response;



public class HeightVolumePair implements Comparable<HeightVolumePair>{
	

	private double height;

	private double volume;
	
	public HeightVolumePair(){

	}
	
	public HeightVolumePair(double height, double volume){
		this.height=height;
		this.volume=volume;
	}
	
	public double getHeight() {
		return height;
	}
	public void setHeight(float height) {
		this.height = height;
	}
	public double getVolume() {
		return volume;
	}
	public void setVolume(float volume) {
		this.volume = volume;
	}
	@Override
	public int compareTo(HeightVolumePair o) {
		int result = 0;
	    double delt = height-o.height;
	    result = delt>0?1:-1;
		return result;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(height);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HeightVolumePair other = (HeightVolumePair) obj;
		if (Double.doubleToLongBits(height) != Double.doubleToLongBits(other.height))
			return false;
		return true;
	}
}
